import cv2 as cv
img = cv.imread('image.jpg')
rows, cols, _ = img.shape
# (旋转的中心点x，旋转的中心点y，旋转的角度，图像缩放因子)
M = cv.getRotationMatrix2D(((cols - 1) / 2.0, (rows - 1) / 2.0), 90, 1)
dst = cv.warpAffine(img, M, (cols, rows))
cv.imshow('img', dst)
cv.waitKey(0)
cv.destroyAllWindows()
